package com.xc.file.api;

import com.xc.file.bean.DownloadBean;
import com.xc.file.bean.HashBean;
import com.xc.file.bean.NoticeBean;
import com.xc.file.config.FeignExceptionHandler;
import com.xc.file.dto.DownloadDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


/**
 * <p>项目名称: Stars</p>
 * <p>描述: 通知</p>
 * <P>创建人:小程 </p>
 * <P>创建人邮箱: 779943476@qq.com</p>
 * <p>创建时间: 2019/11/21</p>
 *
 * @version v1.0
 */
@Component
@FeignClient(name = "${xc.feign.cloud}", configuration = {FeignExceptionHandler.class})
public interface NoticeApi {

    /**
     * 启动通知
     *
     * @param noticeBean 参数
     */
    @PostMapping(value = "/notice")
    public void notice(@RequestBody NoticeBean noticeBean) throws Exception;

    /**
     * 上传成功通知
     *
     * @param hashBean hash信息
     * @return 文件id
     */
    @PostMapping(value = "/notice/success")
    public String noticeSuccess(@RequestBody HashBean hashBean);

    /**
     * 下载验证hashCode是否正确
     *
     * @param downloadBean hash信息
     * @return 文件名称
     */
    @PostMapping(value = "/notice/download")
    public DownloadDto noticeDownload(@RequestBody DownloadBean downloadBean);
}
